import java.util.Comparator;

class Student implements Comparable<Student> {
    public String name;
    public int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public int compareTo(Student o) {
        return  this.name.compareTo(o.name);
    }
}
public class Test2 {

    public static void main(String[] args) {
        Student s1 = new Student("张三",19);
        Student s2 = new Student("李四",18);
        System.out.println(s1.compareTo(s2));
    }
}
